import java.awt.*;
import javax.swing.*;

class JFrameDemo2 {
    public static void main(String [] args) {
        JFrame frame = new JFrame("JFrameDemo2");
        JButton button = new JButton("Press Me");
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        panel.add(button,BorderLayout.CENTER);
        frame.setContentPane(panel);
        frame.pack();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
